package cn.huiyunche.base.service.enums;

/**
 * 用户等级
 * 分为：A级用户 B级用户 C级用户 D级用户
 *
 * @author lm
 */
public enum UserLevelEnum {

    LEVEL_A(10, "A级用户"),
    LEVEL_B(20, "B级用户"),
    LEVEL_C(30, "C级用户"),
    LEVEL_D(40, "D级用户"),;

    private final int value;
    private final String text;

    UserLevelEnum(int value, String text) {
        this.value = value;
        this.text = text;
    }

    public int getValue() {
        return value;
    }

    public String getText() {
        return text;
    }

    public static UserLevelEnum getByValue(int value) {
        for (UserLevelEnum temp : UserLevelEnum.values()) {
            if (temp.getValue() == value) {
                return temp;
            }
        }
        return null;
    }
}